package com.example.congdongapp;
 
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageButton;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageButton;
import android.view.View;
import android.view.View.OnClickListener;
 
public class MainActivity extends Activity {
 
//	Button button;
	ImageButton imageButton01;
	ImageButton imageButton02;
	ImageButton imageButton03;
	ImageButton imageButton04;
	ImageButton imageButton05;
	ImageButton imageButton06;
	ImageButton imageButton07;
	ImageButton imageButton08;
	ImageButton imageButton09;
	ImageButton imageButton010;
	ImageButton imageButton011;
	ImageButton imageButton012;
	

 
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
 
		addListenerOnButton();
 
	}
 
	public void addListenerOnButton() {
 
//		button = (Button) findViewById(R.id.button1);
		imageButton01 = (ImageButton) findViewById(R.id.imageButton1);
		imageButton02 = (ImageButton) findViewById(R.id.imageButton2);
		imageButton03 = (ImageButton) findViewById(R.id.imageButton3);
		imageButton04 = (ImageButton) findViewById(R.id.imageButton4);
		imageButton05 = (ImageButton) findViewById(R.id.imageButton5);
		imageButton06 = (ImageButton) findViewById(R.id.imageButton6);
		imageButton07 = (ImageButton) findViewById(R.id.imageButton7);
		imageButton08 = (ImageButton) findViewById(R.id.imageButton8);
		imageButton09 = (ImageButton) findViewById(R.id.imageButton9);
		imageButton010 = (ImageButton) findViewById(R.id.imageButton10);
		imageButton011 = (ImageButton) findViewById(R.id.imageButton11);
		imageButton012 = (ImageButton) findViewById(R.id.imageButton12);
		
		

		
//		button.setOnClickListener(new OnClickListener() {
// 
//			@Override
//			public void onClick(View arg0) {
// 
//			  Intent browserIntent = 
//                            new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.mkyong.com"));
//			    startActivity(browserIntent);
// 
//			}
// 
//		});
		
		imageButton01.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
				startActivity(browserIntent);
			}
		});
		
		imageButton02.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.ngoisao.net"));
				startActivity(browserIntent);
			}
		});
		
		imageButton03.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.dantri.vn"));
				startActivity(browserIntent);
			}
		});
		
		imageButton04.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.bbc.co.uk/vietnamese/"));
				startActivity(browserIntent);
			}
		});
		
		imageButton05.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vietnamnet.vn"));
				startActivity(browserIntent);
			}
		});
		
		imageButton06.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.thanhnien.com.vn"));
				startActivity(browserIntent);
			}
		});
		
		imageButton07.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.baomoi.com"));
				startActivity(browserIntent);
			}
		});
		
		imageButton08.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.thethaovanhoa.vn"));
				startActivity(browserIntent);
			}
		});
		
		imageButton09.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.antg.com.vn"));
				startActivity(browserIntent);
			}
		});
		
		imageButton010.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://boxitvn.wordpress.com/"));
				startActivity(browserIntent);
			}
		});
		
		imageButton011.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.bongda.com.vn/"));
				startActivity(browserIntent);
			}
		});
		
		imageButton012.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://us.24h.com.vn/"));
				startActivity(browserIntent);
			}
		});
		
		
 
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
 
}


//package com.mkyong.android;
//
//import android.app.Activity;
//import android.content.Intent;
//import android.net.Uri;
//import android.os.Bundle;
//import android.widget.Button;
//import android.widget.ImageButton;
//import android.view.View;
//import android.view.View.OnClickListener;
//
//public class MyAndroidAppActivity extends Activity {
//
//	ImageButton imageButton01;
////	ImageButton imageButton02;
////	ImageButton imageButton03;
////	ImageButton imageButton04;
////	ImageButton imageButton05;
////	ImageButton imageButton06;
////	ImageButton imageButton07;
////	ImageButton imageButton08;
////	ImageButton imageButton09;
////	ImageButton imageButton010;
////	ImageButton imageButton011;
////	ImageButton imageButton012;
////	ImageButton imageButton013;
////	ImageButton imageButton014;
////	ImageButton imageButton015;
////	ImageButton imageButton016;
////	ImageButton imageButton017;
////	ImageButton imageButton018;
////	ImageButton imageButton019;
////	ImageButton imageButton020;
//	
//
//	@Override
//	public void onCreate(Bundle savedInstanceState) {
//		super.onCreate(savedInstanceState);
//		setContentView(R.layout.main);
//
//		addListenerOnButton();
//
//	}
//
//	public void addListenerOnButton() {
//
//		imageButton01 = (ImageButton) findViewById(R.id.imageButton1);
////		imageButton02 = (ImageButton) findViewById(R.id.imageButton2);
////		imageButton03 = (ImageButton) findViewById(R.id.imageButton3);
////		imageButton04 = (ImageButton) findViewById(R.id.imageButton4);
////		imageButton05 = (ImageButton) findViewById(R.id.imageButton5);
////		imageButton06 = (ImageButton) findViewById(R.id.imageButton6);
////		imageButton07 = (ImageButton) findViewById(R.id.imageButton7);
////		imageButton08 = (ImageButton) findViewById(R.id.imageButton8);
////		imageButton09 = (ImageButton) findViewById(R.id.imageButton9);
////		imageButton010 = (ImageButton) findViewById(R.id.imageButton10);
////		imageButton011 = (ImageButton) findViewById(R.id.imageButton11);
////		imageButton012 = (ImageButton) findViewById(R.id.imageButton12);
////		imageButton013 = (ImageButton) findViewById(R.id.imageButton13);
////		imageButton014 = (ImageButton) findViewById(R.id.imageButton14);
////		imageButton015 = (ImageButton) findViewById(R.id.imageButton15);
////		imageButton016 = (ImageButton) findViewById(R.id.imageButton16);
////		imageButton017 = (ImageButton) findViewById(R.id.imageButton17);
////		imageButton018 = (ImageButton) findViewById(R.id.imageButton18);
////		imageButton019 = (ImageButton) findViewById(R.id.imageButton19);
////		imageButton020 = (ImageButton) findViewById(R.id.imageButton20);
//		
//		
//		imageButton01.setOnClickListener(new OnClickListener() {
//			@Override
//			public void onClick(View arg0) {
//				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
//				startActivity(browserIntent);
//			}
//		});
////		imageButton02.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
////		imageButton03.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
////		imageButton04.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
////		imageButton05.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
////		imageButton06.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
////		imageButton07.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
////		imageButton08.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
////		imageButton09.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
////		imageButton010.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
////		imageButton011.setOnClickListener(new OnClickListener() {
////			@Override
////			public void onClick(View arg0) {
////				Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.vnexpress.vn"));
////				startActivity(browserIntent);
////			}
////		});
//		
//	}
//
//}


